//import axios from 'axios'

//let baseUrl = process.env.BASE_URL
					

const axiosApi = {
  getIndexSwipe : (params) => {
	//console.log(process.env)
    return axios.get(`/index/swipe`,{ params })
  },
  
  getIndexNewpro : (params) => {
    return axios.get(`/index/newpro`, { params })
  },
  
  getIndexHotpro : (params) => {
    return axios.get(`/index/hotpro`, { params })
  },
  
  getIndexReviews : (params) => {
    return axios.get(`/index/reviews`, { params })
  },
  
  postIndexAllCategoryGoodsList : (params) => {
    return axios.post(`/goods/category`, { params })
  },
  
  postProductDetail : (params) => {
    return axios.post(`/goods/prodetail`, { params })
  },
  
  postUsrData : (params) => {
    return axios.post(`/usr/getUsrData`, { params })
  },
  
  postUsrCart : (params) => {
    return axios.post(`/usr/getUsrCart`, { params })
  },
  
  postUsrCartSkuDetail : (params) => {
    return axios.post(`/goods/skuDetail`, { params })
  },
  
  postUsrCartSkusDetails : (params) => {
    return axios.post(`/goods/skusDetails`, { params })
  },
  
  postUsrCartSetUsrCartCount : (params) => {
    return axios.post(`/usr/setUsrCartCount`, { params })
  },
  
  postCheckbillAddbill : (params) => {
    return axios.post(`/usr/addBill`, { params })
  },
  
  postUsrBill : (params) => {
    return axios.post(`/usr/getUsrBill`, { params })
  },
  
  postDeleteUsrBill : (params) => {
    return axios.post(`/usr/deleteBill`, { params })
  },
  //......
}

//2) 定义axios变量等待接收axios,保证axios可用
var axios = null
export default ({ $axios }, inject) => {

  //3 保存内置的axios
  axios = $axios

  //4) 将自定义函数交于nuxt
  inject('axiosApi', axiosApi)
}